<style>
body{background: #f6f6f6;}
.dataTables_info,.dataTables_length{
	display: none;
}

#transactionRecord thead tr th{
	font-weight: normal;
	font-size: .95em;
	text-align:center;
    padding: 5px;
}

#transactionRecord tbody tr td{
	font-size: .95em;
	text-align:center;
    padding: 5px;
}

#transactionRecord{
	margin-top: 1em;
}

.tableSearch{
	position: fixed;
	width:100%;
	display: block !important;
	margin-top: 1em;
}

.blackBg[data-v-0a725a61] {
    background: rgba(0,0,0,.4);
    top: 3em;
}

.filter[data-v-0a725a61] {
    top: 3em;
    z-index: 150;
}

</style>
<div class="wapper" id="subTransactionDetail">
	<div class="col-xs-12 col-sm-4 col-sm-offset-4 text-center tops" style="color:white;background: #059BF3;height: 50px;line-height:50px;position: fixed;margin-top: 0px;left: 0px;z-index: 100;padding-left:0;padding-right:0;">
		<a  class="glyphicon glyphicon-chevron-left fl" onclick="backPage()" style="cursor:pointer; color: white;position:absolute;top:50%;transform:translateY(-50%);font-size: 20px;left:10px;"></a>
		<span style="font-size: 16px;">下级交易明细</span>
	</div>
	
	<div data-v-0a725a61="" class="col-xs-12 col-sm-4 col-sm-offset-4 main">
	<div data-v-0a725a61="" class="dataType"><em data-v-0a725a61="">今天</em><i data-v-0a725a61="" class="defFont"></i></div>
	<div data-v-0a725a61="" class="searchBtn">
		<div data-v-0a725a61="" class="search"><input data-v-0a725a61="" type="text" placeholder="请输入下级账号"><span data-v-0a725a61="">搜索</span></div>
	</div>
	<div data-v-0a725a61="" id="leftTabBox">
		<div data-v-0a725a61="" class="hd">
			<ul data-v-0a725a61="">
				<li data-v-0a725a61="" class="on">账户明细</li>
				<li data-v-0a725a61="">提现记录</li>
				<li data-v-0a725a61="">充值记录</li>
			</ul>
		</div>
		<div data-v-0a725a61="" class="bd dontSelect">
			<div data-v-0a725a61="" class="scrollBox">
				<div data-v-0a725a61="" class="touchScroll">
					<table class="class-tableDataTable class-table-needClick display table table-striped table-bordered table-hover" id="transactionRecord">
						<!--<thead style="display:none;">
						 	<tr>
							</tr>
						</thead>
						<tbody></tbody> -->
					</table>
					<div data-v-0a725a61="" class="fullPageMsg">
						<p data-v-0a725a61="">暂无记录</p>
					</div>
				</div>
			</div>
			<div data-v-0a725a61="" class="scrollBox">
				<!---->
			</div>
			<div data-v-0a725a61="" class="scrollBox">
				<!---->
			</div>
			<div data-v-0a725a61="" class="scrollBox">
				<!---->
			</div>
		</div>
	</div>
	<div data-v-0a725a61="" class="timer" style="display: none;">
		<div data-v-0a725a61="" class="blackBg"></div>
		<div data-v-0a725a61="" class="filter">
			<div data-v-0a725a61="" class="tp"><span data-v-0a725a61="" class="on">今天</span><span data-v-0a725a61="" class="">昨天</span><span data-v-0a725a61="" class="">七天</span></div>
			<!-- <div data-v-0a725a61="" class="bt"><span data-v-0a725a61="" class="on">全部彩种</span><span data-v-0a725a61="" class="">重庆时时彩</span><span data-v-0a725a61="" class="">新疆时时彩</span><span data-v-0a725a61="" class="">天津时时彩</span><span data-v-0a725a61="" class="">幸运时时彩</span><span data-v-0a725a61="" class="">好运时时彩</span><span data-v-0a725a61="" class="">广东11选5</span><span data-v-0a725a61="" class="">上海11选5</span><span data-v-0a725a61="" class="">山东11选5</span><span data-v-0a725a61="" class="">江西11选5</span><span data-v-0a725a61="" class="">幸运11选5</span><span data-v-0a725a61="" class="">好运11选5</span><span data-v-0a725a61="" class="">福彩3D</span><span data-v-0a725a61="" class="">排列3</span><span data-v-0a725a61="" class="">香港⑥合彩</span><span data-v-0a725a61="" class="">幸运⑥合彩</span><span data-v-0a725a61="" class="">好运⑥合彩</span><span data-v-0a725a61="" class="">北京快乐8</span><span data-v-0a725a61="" class="">北京PK10</span><span data-v-0a725a61="" class="">幸运PK10</span><span data-v-0a725a61="" class="">北京28</span><span data-v-0a725a61="" class="">幸运28</span><span data-v-0a725a61="" class="">幸运飞艇</span><span data-v-0a725a61="" class="">好运PK10</span><span data-v-0a725a61="" class="">好运28</span><span data-v-0a725a61="" class="">江苏快3</span><span data-v-0a725a61="" class="">安徽快3</span><span data-v-0a725a61="" class="">广西快3</span><span data-v-0a725a61="" class="">吉林快3</span><span data-v-0a725a61="" class="">湖北快3</span><span data-v-0a725a61="" class="">北京快3</span><span data-v-0a725a61="" class="">幸运快3</span><span data-v-0a725a61="" class="">河北快3</span><span data-v-0a725a61="" class="">贵州快3</span><span data-v-0a725a61="" class="">上海快3</span><span data-v-0a725a61="" class="">甘肃快3</span><span data-v-0a725a61="" class="">TT快3</span><span data-v-0a725a61="" class="">好运快3</span><span data-v-0a725a61="" class="">竞彩足球</span><span data-v-0a725a61="" class="">竞彩篮球</span><span data-v-0a725a61="" class="">好运连连</span><span data-v-0a725a61="" class="">极限竞速</span><span data-v-0a725a61="" class="">农场大亨</span>
			</div> -->
			<!---->
			<!-- <div data-v-0a725a61="">
				<div data-v-0a725a61="" class="BTN fil-btn">筛 选</div>
			</div> -->
		</div>
	</div>
</div>

	
</div>
<script>
$(".foot").hide();
var startTime = GetDateStr(0);
var endTime=GetDateStr(0);
var cName="";
var subName="";
var dataTable;
var state=0;/**默认值传0  0-账户明细     1-提现记录   2-充值记录*/
var columns=[
	{title:"用户名","data": "huiyuanzh","className":" huiyuanzh-td"},
	{title:"变动类型","data": "bdtype", "className": "bdtype-td"},
	{title:"变动前金额","data": "bdqjine", "className": "bdqjine-td"},
	{title:"变动金额", "data": "bdjine", "className": "bdjine-td"},
	{title:"变动后金额","data": "bdhjine", "className": "bdhjine-td"},
	{title:"时间","data": "createtime", "className": "createtime-td"},
];

function dataTable01(){
	dataTable=	$("#transactionRecord").DataTable({
			 "bProcessing" : false, 
			"bServerSide" : true,
			 "bPaginate" : true, 
			"sAjaxSource" : "/agencyCenter/subordinatePipeline.do",
			"fnServerData" : retrieveData, 
			"destroy":true,
		       "bLengthChange": true,      
		      "bSort": false,
		      "bAutoWidth": false,
		      'aLengthMenu':[5], 
		       "searching": false,  
		       "pagingType": "full",
		       "dom": "t<'tableinfo'i<'tableSearch'p>l>",  
		       
		       "language": {
		             "lengthMenu": "每页显示 _MENU_ 条记录",     
		             "zeroRecords": "没有检索到数据",     
		            "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录",   
		            "info": "没有数据",  
		            "oPaginate": {     
		                "sFirst": "首页",     
		                "sPrevious": "前一页",     
		                "sNext": "后一页",     
		                "sLast": "尾页"    
		          	},
		            "search":"",
		            "searchPlaceholder": "请输入关键字",
		            "infoFiltered":   "(从  _MAX_ 记录中搜索出结果)",
		            "infoEmpty":      "没有找到匹配的信息",
		         },  
		         "columnDefs": [{"defaultContent": "",
                      "targets": "_all"}],
                      "columns":columns,
		});
	function retrieveData(sSource, aoData, fnCallback) {
		$.ajax({
			url : sSource,
			data : {
				"pageCount":aoData[0].value,
				"startIndex":aoData[3].value,
				"lineCount":aoData[4].value,
				"state":state,
				"name":$(".search input").val(),
				"cname":subName,
				"date1":startTime,
				"date2":endTime,
			},
			type : 'post',
			dataType : 'json',
			async : false,
			success : function(result) { 
				var newJson = result.aaData;
				console.log(newJson);
				if(newJson==""){
					if($(".search input").val()!=""){
						layer.alert("没用这个下级用户,请重新输入");
						$(".search input").val("");
						return;
					}
					$("#betRecord").css("border","none");
					$(".tableinfo").hide();
				}else if(newJson.length>5){
					$("#betRecord").css("border","1px solid #ddd");
					$("#betRecord").css("border-bottom","none");
					$(".tableinfo").show();
				}	
        		 for (var i = 0; i < newJson.length; i++) {
         			 var item = newJson[i];
        		 }
        		 result.aaData=newJson;
				fnCallback(result);
			},
			error : function(msg) {
			}
		});
	};
}
dataTable01();


/* 账户明细，提现记录和充值记录之间的切换 */
$(".hd li").on("click",function(){
	$(this).addClass("on");
	$(this).siblings().removeClass("on");
	var index=$(this).index();
	if(index==0){
		state=0;
		columns=[
			{title:"用户名","data": "huiyuanzh","className":" huiyuanzh-td"},
			{title:"变动类型","data": "bdtype", "className": "bdtype-td"},
			{title:"变动前金额","data": "bdqjine", "className": "bdqjine-td"},
			{title:"变动金额", "data": "bdjine", "className": "bdjine-td"},
			{title:"变动后金额","data": "bdhjine", "className": "bdhjine-td"},
			{title:"时间","data": "createtime", "className": "createtime-td"},
		];
	}else if(index==1){
		state=1;
		columns=[
			{title:"用户名","data": "name","className":" name-td"},
			{title:"提现金额","data": "fukuanje", "className": "fukuanje-td"},
			{title:"状态","data": "state", "className": "state-td"},
			{title:"申请时间","data": "sqtime", "className": "sqtime-td"},
		];
	}else if(index==2){
		state=2;
		columns=[
			{title:"用户名","data": "name","className":" name-td"},
			{title:"充值金额","data": "fukuanje", "className": "fukuanje-td"},
			{title:"充值方式","data": "type", "className": "type-td"},
			{title:"状态","data": "state", "className": "state-td"},
			{title:"申请时间","data": "sqtime", "className": "sqtime-td"},
		];
	}
	dataTable.destroy();
	dataTable.clear();
	$("#transactionRecord").empty();
	dataTable01();
});

/* 搜索下级账号 */
$(".search span").on("click",function(){
	if($(".search input").val()==""){
		return;
	}
	dataTable.destroy();
	dataTable01();
});

	/* 点击选择日期切换 */
	$(".dataType").on("click",function(){
		$(".timer").toggle();
		if($(".timer").css("display")=="block"){
			$(".blackBg").on("click",function(e){
				$(".timer").hide();
			});
		}
	});
	
	/* 确定选择日期 */
	$(".filter").on("click",".tp span",function(){
		/* 团队报表下选择日期 */
		$(".timer").hide();
		var index=$(this).index();
		$(this).addClass("on");
		$(this).siblings().removeClass("on");
		$(".dataType em").text($(this).text());
		if(index==0){
			startTime=GetDateStr(0);
		}else if(index==1){
			startTime=GetDateStr(1);	
		}else if(index==2){
			startTime=GetDateStr(7);	
		}
		dataTable01();
	});

</script>